//
//  WebViewProgressLine.m
//  customer
//
//  Created by Holothurian on 2018/10/21.
//  Copyright © 2018年 yinlong. All rights reserved.
//

#import "WebViewProgressLine.h"

@implementation WebViewProgressLine

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.hidden = YES;
    }
    return self;
}

- (void)setColorLine:(UIColor *)colorLine{
    _colorLine = colorLine;
    self.backgroundColor = colorLine;
}

- (void)startAnimation{
    self.hidden = NO;
    self.frame = CGRectZero;
    [UIView animateWithDuration:0.4 animations:^{
        self.frame = CGRectMake(0,NAVIGATION_BAR_HEIGHT, 0.4 * F_DEVICE_W, 3);
    } completion:^(BOOL finished) {
        self.frame = CGRectMake(0,NAVIGATION_BAR_HEIGHT, 0.8 * F_DEVICE_W, 3);
    }];
}

- (void)stopAnimation{
    [UIView animateWithDuration:0.4 animations:^{
        self.frame = CGRectMake(0, NAVIGATION_BAR_HEIGHT, F_DEVICE_W, 3);
    } completion:^(BOOL finished) {
        self.hidden = YES;
    }];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
